<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/qrcode.min.js" type="text/javascript"></script>
</head>
<body>
    <div id="qrcode"></div>
<script>
    var orderNo = "D100000120211216141146080059";
    $.ajax({
        url:"api/wxpay/createqccode/"+orderNo,
        method:"get",
        success:function (data) {
           new QRCode(document.getElementById('qrcode'), data.data.codeUrl);
        }
    });
    var timeId;
    function getOrderStatus() {
        clearTimeout(timeId);
        $.getJSON('/trade/api/wxpay/queryorderstatus/'+orderNo,function (data){
            if(data.data.orderStatus == 2){
                location.href = 'http://localhost/index.html#/orderpaystate?orderNo='+orderNo+'&id='+data.data.id;
            }else{
                timeId = setTimeout('getOrderStatus()',1000);
            }
        });
    }
    getOrderStatus();
</script>
</body>
</html>